    <h1> :: Consultar Cursos </h1>

<?php   
	include ('conecta.php');
	
	$consulta='select idCurso,nomeCurso from tbCurso';
	$resultado=mysql_query ($consulta, $conexao);
	if (mysql_num_rows($resultado) > 0)
{
   ?>         
        <table class="tab" border="0" cellspacing="2" cellpadding="0">
        <tr>
            <td width="40" height="30" valign="middle"><strong>ID:</strong></td>
            <td width="200" height="30" valign="middle"><strong>Nome:</strong></td>
            <td width="200" height="30" valign="middle"><strong>Visualizar:</strong></td>
            <td width="50" align="center" valign="middle"><strong>Editar</strong></td>
            <td width="50" align="center" valign="middle"><strong>Excluir</strong></td>
        </tr>     
            
	<?php
        while ($linha = mysql_fetch_array($resultado)) 
        {
    	$idCurso = $linha['idCurso'];    
        $nomeCurso = $linha['nomeCurso'];
        ?>    
        <tr>
            <td valign="middle" bgcolor="#B1B1B1"><?php echo $idCurso;?></td>
            <td valign="middle" bgcolor="#B1B1B1"><?php echo $nomeCurso;?></td>
            <td width="50" align="center" valign="middle" bgcolor="#B1B1B1"><a href="#" alt="" ><img src="Imagens_BG/reload.png" width="20" height="20"></a></td>
            <td width="50" align="center" valign="middle" bgcolor="#B1B1B1"><a href="?page=EditarCurso&id=<?php echo $idCurso; ?>" alt="" ><img src="Imagens_BG/reload.png" width="20" height="20"></a></td>
            <td width="50" align="center" valign="middle" bgcolor="#B1B1B1"><a href="cad_curso.php?page=excluir&id=<?php echo $idCurso; ?>" alt="" ><img src="Imagens_BG/cancel.png" width="20" height="20"></a></td>
        </tr>
    

                <?php
            }
}
else
	echo "<h1> A lista está vazia. </h1> <br>";

//Fecha a conexão com o servidor
mysql_close($conexao);
?>    